package second;

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * @ClassName TCPClient
 * @Description TODO
 * @Author 14784
 * @Date 2020/9/24 15:31
 * @Version 1.0
 */
public class TcpClient {
    public static void main(String[] args) {
        try {
            Socket socket = new Socket("127.0.0.1", 8081);

            new Thread(new SendMessageService(socket, "客户端：")).start();
            new Thread(new ReceiveMessageService(socket)).start();

            System.out.println("请输入...");

        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
